package com.examination.system.administrato;


import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.CopyOnWriteArrayList;
/**
 * 异常
 * java.util.ConcurrentModificationException
 * 解决办法
 * 3.1 枷锁
 * 3.2
 */

/**
 * @author 寇淇芮
 * @Date 2019/10/12 22:58
 */
public class SaleTicketDemo03 {
    public static void main(String[] args) {

    }

    private static void listNotSafa() {
        List<String> lists = new ArrayList<>();//new CopyOnWriteArrayList<>();
        for (int i = 0; i <30 ; i++) {
            new Thread(()->{
                lists.add(UUID.randomUUID().toString().substring(0,8));
                System.out.println(lists);
            },String.valueOf(i)).start();
        }
    }
}
